< previous page page_189 next page >

Page 189
         End If
      End If
   Next ValueIndex
   Set EnumerateValues = ValueCollection
End Function
Conclusion
The parameter-type bug shown in this puzzle is one of the most subtle bugs you'll meet when working with API functions, especially because it isn't really an API declaration bug at all. Accidentally using a variant because you forgot to declare a parameter type usually won't cause a program to fail. But it is inefficient and can lead to serious problems if you are creating public ActiveX components, because variants demand a much greater degree of error checking than do base variable types when used as component properties or parameters.

 
< previous page page_189 next page >